package org.stone.project.mybatisIntegration.config;

import com.github.pagehelper.PageInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.stone.project.mybatisIntegration.prop.PageHelperProp;

import java.util.Properties;

@Configuration
public class MybatisPlusConfig {
    @Autowired
    private PageHelperProp pageHelperProp;

    @Bean
    public PageInterceptor pageHelperPageInterceptor(){
        PageInterceptor pageInterceptor = new PageInterceptor();
        pageInterceptor.setProperties(pageHelperProp);
        return pageInterceptor;
    }
}
